package com.example.myhuangye.YH;

import android.content.Intent;
import android.net.Uri;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.view.View.OnClickListener;

import com.example.myhuangye.R;

public class MainYH1ctivity extends AppCompatActivity implements OnClickListener{
private Button NYID;
    private Button btn_call;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main_yh1ctivity);
        NYID = (Button) findViewById(R.id.NYID);
        NYID.setOnClickListener(this);

        btn_call = (Button) findViewById(R.id.btn_call);
        btn_call.setOnClickListener(this);

        findViewById(R.id.HT1).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                finish();
            }
        });

    }


    public void onClick(View view) {
        switch (view.getId()){
            case R.id.NYID:
                Uri uri = Uri.parse("http://www.abchina.com");
                Intent intent = new Intent(Intent.ACTION_VIEW, uri);
                startActivity(intent);

                break;
            case R.id.btn_call:
                Intent intent1=  new Intent(Intent.ACTION_DIAL);
                intent1.setData(Uri.parse("tel:95599"));
                startActivity(intent1);
            break;

        }


    }
}